import 'babel-polyfill';
import prod from './prod';
import dev from './dev';
import redisdb from './redisdb';

const env = (process.argv[2] === 'online' ? 'prod' : 'dev');

// env configs
const envConfigs = { prod, dev };

// common configs
const DEFAULTS = {
    env,
    redisdb,
    serverHost: process.env.npm_package_config_host || '0.0.0.0',
    serverPort: process.env.npm_package_config_port || 9090,
    useAccessLog: true, // 是否记录access日志
    corsCheckDomain: '', // CORS操作时检查的域名
};

export default Object.assign({}, DEFAULTS, envConfigs[env]);
